<template>
  <XnDialog custom-class="branch_dialog" title="评分标准" :visible.sync="selfVisible" @close="close">
    <!-- <el-scrollbar class="criteria">
      <div class="standard_remark">
        提示：根据“德、能、勤、绩、廉”给出相应的考核等次（好（100分）、较好（80分）一般（60分）、较差（0分））。
      </div>
      <div class="list" v-for="(item, index) in scoreData" :key="index">
        <div class="list_tit">{{ item.title }}</div>
        <div class="list_con">
          <div class="li" v-for="(li, i) in item.dataList" :key="i">
            <div class="li_l">
              <div class="grade">{{ li.label }}</div>
              <div class="score">{{ li.min }}-{{ li.max }}</div>
            </div>
            <div class="li_v">{{ li.brief }}</div>
          </div>
        </div>
      </div>
    </el-scrollbar> -->
    <el-scrollbar class="criteria">
      <div class="standard_remark">
        {{ scoreDataNew.assessDesc }}
      </div>
      <div class="standard_con">
        <CollapseComponent :collapseData="scoreDataNew.children"></CollapseComponent>
      </div>
    </el-scrollbar>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="close" size="mini">关 闭</el-button>
    </span>
  </XnDialog>
</template>

<script>
import XnDialog from '@com/xnDialog.vue'
import scoreData from './scoreData'
import CollapseComponent from './CollapseComponent'
import { getAssessTarget } from '@apis/evaluation.js'
// 评分标准
export default {
  name: 'ScoringCriteria',
  components: { XnDialog, CollapseComponent },
  props: {
    criteriaShow: Boolean,
  },
  data() {
    return {
      selfVisible: false,
      scoreData: scoreData,
      scoreDataNew: {},
    }
  },
  computed: {},
  watch: {
    criteriaShow(bool) {
      this.selfVisible = bool
    },
  },
  created() {
    this.getAssessTarget()
  },
  mounted() {},
  methods: {
    close() {
      this.selfVisible = false
      this.$emit('close', false)
      this.$emit('update:visible', false)
    },
    getAssessTarget() {
      getAssessTarget({
        id: this.$route.query.needId,
      }).then(res => {
        console.log('res.data :>> ', res.data)
        this.scoreDataNew = res.data
      })
    },
  },
}
</script>

<style lang="scss" scoped>
/deep/ .el-dialog {
  height: 65vh;
  width: 65%;
  .el-dialog__body {
    padding: 10px 30px 0;
  }
  .el-dialog__footer {
    font-size: 16px;
  }
}
.criteria {
  overflow: hidden;
  height: calc(65vh - 120px);
  .list {
    margin-bottom: 20px;
    .list_tit {
      font-size: 16px;
      font-weight: 600;
      border-left: 3px solid #004db6;
      padding-left: 10px;
    }
    .list_con {
      padding: 20px;
      .li {
        display: flex;
        align-items: center;
        border: 1px solid #ccc;
        font-size: 14px;
        &:not(:last-of-type) {
          border-bottom: 0;
        }
        .li_l {
          width: 80px;
          border-right: 1px solid #ccc;
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          padding: 5px;
        }
        .li_v {
          padding: 5px;
          flex: 1;
          line-height: 25px;
        }
      }
    }
  }
}
.standard_remark {
  display: flex;
  // padding-left: 20px;
  // margin-bottom: 20px;
  font-weight: 600;
  color: #d9110d;
  font-size: 15px;
  margin-bottom: 5px;
  .content {
    div {
      margin-bottom: 6px;
    }
  }
}
</style>
